How to Remove Dashes (

您所在的位置:网站首页 how to delete pages in excel How to Remove Dashes (

How to Remove Dashes (

2023-02-19 15:05| 来源: 网络整理| 查看: 265

How to Remove Dashes (-) in Excel? by Steve

Sometimes, you may get data (text or numbers) that have dashes (or hyphens) in it.

If you want to remove these dashes in Excel, you can use a couple of methods.

And no… doing it manually is not one of the options I cover here.

This can be particularly useful when you get social security numbers data (which is in AAA-GG-SSSS format), and you want to remove these dashes and just get the number.

Let me show you two really simple ways to do this.

Remove Dashes using Find and Replace

The easiest way to remove dashes in Excel is to use the Find and Replace feature.

As the name suggests, you can find all the cells that have a dash (or hyphen) in it and then replace it with a space character or a null string.

Let’s see how to do this.

Suppose you have SSN data as shown below and you want to remove the dash and only get the numbers.

SSN-Dataset-to-remove-dash-in-Excel

Below are the steps to use find and replace to remove dashes in Excel:

Select the dataset from which you want to remove the dashes Hold the Control key and then press the H key. This will open the Find and Replace dialog box. In the ‘Find what’ field, type the dash symbol (-)Find-what-field-enter-the-dash Leave the ‘Replace with’ field emptyreplace-with-field-leave-blank Click on Replace All.

The above steps would remove all the dashes from the cells and you will be left with the numbers only.

This is a really quick method to remove dashes in Excel, but there are a couple of things you need to know when using it:

It changes the original data. In case you may need the original data later, make sure you create a backup copy before doing this. When your number starts with a 0 (for example in 087-54-7465), this method would give you the result where the leading zero has been removed. This is something Excel does (try entering 001 in a cell and you will see it is changed to 1 only). If you need to change the format of the cell to show at least 9 digits. Also read: How to Remove Question Marks from Text in Excel? Remove Dashes using Formula

Another simple method to get rid of dashes in Excel is to use formulas.

Suppose you have SSN data as shown below and you want to remove the dash and only get the numbers.

Dataset-to-remove-dash-in-Excel

The below Excel formula will do this:

=SUBSTITUTE(A2,"-","") Substitute-formula-to-remove-dashes-hyphens-in-Excel

The above SUBSTITUTE formula takes three arguments:

A2 – the cell from which you want to remove the text string (dashes in this example) “-” – The string you want to remove (you need to place it in double-quotes) “” – What you want to replace it with. In this example, I want to substitute dashes with blank (null string)

The above formula looks for the dash (or hyphen or whatever you specify) in the cell and replaces it with a null string (which essentially means is that it removes all the dashes in the cell).

Other Excel tutorials you may find useful:

How to Remove Dotted Lines in Excel How to Remove Apostrophe in Excel How to Remove Formulas in Excel (and keep the data) How to Remove Macros from Excel? How to Remove Dollar Sign in Excel How to Remove Text after a Specific Character in Excel How to Remove a Specific Character from a String in Excel How to Delete/Remove Checkbox in Excel? Fill Blank Cells with Dash (-) in Excel (3 Easy Ways)


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3